
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/DatePicker.js"></script>
    <script type="application/javascript" src="../layui/layui.js"></script>
    <script src="../js/vue.js"></script>
    <title>商品列表</title>

</head>
<body>
<div class="row" style="width:98%;margin-left: 1%;">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                车辆列表
            </div>
            <div class="panel-body">


                <div class="row" style="">
                    <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
                        <div class="form-group form-inline">
                            <span>车辆名字</span>
                            <input type="text" name="name"  class="form-control">
                        </div>
                    </div>
                    <button type="button"  lay-submit lay-filter="formDemo" class="btn btn-primary" id="search" style="margin-top: 22px;margin-left: 50px;"  ><span class="glyphicon glyphicon-search" ></span></button>
                </div>
            </div>

            <div style="height: 400px;overflow: scroll;">
                <table id="tb_list" class="table table-striped table-hover table-bordered">
                    <tr>
                        <td>序号</td>
                        <td>车辆名称</td>
                        <td>类型</td>
                        <td>座位</td>
                        <td>数量</td>
                        <td>操作</td>
                    </tr>
                    <tr v-for="car in cars">
                        <td>{{car.id}}</td>
                        <td>{{car.name}}</td>
                        <td>{{car.type}}</td>
                        <td>{{car.sitnum}}</td>
                        <td>{{car.price}}</td>
                        <td>
                            <button @click="del(car.id)">删除</button>
                            |
                            <button @click="update(car.id)">修改</button>
                        </td>

                    </tr>
                    </c:forEach>
                </table>
            </div>
        </div>
    </div>
</div>
<script>

    //jquery工厂函数
    $(function () {
        loadUser() ;
    });
    function loadUser() {
        $.ajax({

            url:'/carlist',
            type:'get',
            dataType:'json',
            success:function (data) {
                console.log(data);
                carInfos.cars=data;

            }
        });
    }
</script>
</body>
</html>